/**
 * Copyright (c) 2018 软唐 All rights reserved.
 *
 * https://www.softtown.cn
 *
 * 版权所有，侵权必究！
 */

package com.softtown.modules.security.dao;

import com.softtown.common.dao.BaseDao;
import com.softtown.modules.security.entity.SysUserTokenEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 系统用户Token
 * 
 * @author Ding Ya Yong
 */
@Mapper
@Component(value = "SysUserTokenDao")
public interface SysUserTokenDao extends BaseDao<SysUserTokenEntity> {

    SysUserTokenEntity getByToken(String token);

    SysUserTokenEntity getByUserId(Long userId);

    void updateToken(@Param("userId") Long userId, @Param("token") String token);

    /**
     * 获取op模式下所有公司用户总数
     * @return
     */
    int getAllCompUserCount();
}
